//
//  Person.swift
//  swift-02-demo
//
//  Created by China Dragon on 2023/8/21.
//

import UIKit

class Person: NSObject {
    @objc var name: String?
    @objc var age: Int = 0
    init(dict:[String : Any]){
        super.init()
        
        //字典转模型
        setValuesForKeys(dict)
    }
    
    //对着描述信息，有利于调试，
    override var description: String{
        let keys = ["name","age"]
        //模型转字典 - 网络到 POST - JSON
        return "\(dictionaryWithValues(forKeys: keys))"
    }

}
